<!--
 * @Author: your name
 * @Date: 2021-05-14 10:10:29
 * @LastEditTime: 2021-05-18 15:00:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \authorizationMobile\pages\ecode.html
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<title>扫码截图</title>
		<link rel="stylesheet" href="../css/amazeui.min.css">
		<style>
			html,body{
				width:100%;
				height:100%;
			}
			#eocde {
				height:100%;
				width:100%;
				position: relative;
			}
			#ecode .ecodeCenterBox{
				position: absolute;
				top:50%;
				left:50%;
				transform: translate(-50%,-50%);
				z-index: 1;
			}
		</style>
	</head>
	<body>
		<div id="ecode" class="am-center">
			<div class="ecodeCenterBox">
				<div class="title am-text-center am-text-lg">
					请截图并发送到公信员工获取授权码
				</div>
				<div id="doc-qrcode" class="am-text-center am-margin-top-xl"></div>
			</div>
		</div>
	</body>
</html>
<script src="../js/jquery-3.1.1.min.js"></script>
<script src="../js/amazeui.min.js"></script>
<script>
	function makeCode(text) {
		$qr = $('#doc-qrcode');
		$qr.empty().qrcode({text: text,width:300,height:300});
	}
	function getStroage(name, callback) {
		let obj = localStorage.getItem(name);
		if (typeof (obj) != 'undefined' && obj != null) {
			callback(JSON.parse(obj))
		} else {
			alert('获取不到授权码，请重新获取');
			window.location.href = "../index.html";
		}
	}
	$(function(){
		   	let location = window.location.href;
			getStroage('port',(data)=>{
				let url=location+'?device='+data.device+'&uuid='+data.uuid;
				makeCode(url);
			})
			   
			
		    
	})
</script>
